package com.cy.myblog.service.impl;

import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cy.myblog.dao.CommentDaoI;
import com.cy.myblog.model.Tcomment;
import com.cy.myblog.service.CommentServiceI;

@Service("commentService")
public class CommentServiceImpl implements CommentServiceI {

	private CommentDaoI commentDao;

	@Autowired
	public void setCommentDao(CommentDaoI commentDao) {
		this.commentDao = commentDao;
	}
	
	public Tcomment save(Tcomment comment){
		comment.setId(UUID.randomUUID().toString());
		commentDao.save(comment);
		return comment;
	}
}
